    
   expit <- function(logodds){ 1/(1+exp(-logodds))}
    
    eXEst = function(Z,X.prop){
        
        N = length(Z)
        
        
        # Logit #
        model = glm(Z~X.prop,family=binomial(link="logit"))
        coef = coefficients(model)
        hateX = expit(cbind(1,X.prop)%*%as.matrix(coef))
        
        # FS #
        k.max = KEst(Z,hateX)
        results.eX = Coarsen_eX_Subclass(hateX,Z,k.max)
        
        
        return(results.eX)
        
    }
    
    
    
 
    
    
    
